<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:common="http://www.contact.common.com/contacts/ui"
      xmlns:core="http://www.contact.core.com/contacts/core/ui"
      xmlns:mail="http://www.contact.mail.com/contacts/mail/ui"
      xmlns:a4j="http://richfaces.org/a4j">

<ui:component>

    <!--@elvariable id="id" type="java.lang.String"-->
    <!--@elvariable id="reRender" type="java.lang.String"-->

    <common:modalPanel id="#{id}"
                       header="#{newFriendSessionBean.header}"
                       bean="#{newFriendBean}"
                       submitButton="Submit"
                       reRender="#{reRender}"
            >

        <ui:define name="panelBody">
            <h:message for="#{id}"/>
            <a4j:outputPanel layout="block" style="min-width:350px">
                <a4j:outputPanel layout="block" style="float:left;">
                    <!--width: 100%; height:100%-->
                    <core:pictureForView style="resize:both; width: 80px;"
                                         pictureKey="photoprofile_#{newFriendBean.informationIdForProccess}"
                                         informationId="#{newFriendBean.informationIdForProccess}"
                            />
                </a4j:outputPanel>

                <h:outputLabel value="#{newFriendSessionBean.message}"/>

                <!--<a4j:outputPanel layout="block" style="float:left;">-->
                <a4j:outputPanel id="newFriendMessagePanel" style="display:none;clear:both;">

                    <mail:composeMessage showReceivers="false" showTopic="false"/>

                </a4j:outputPanel>
                <!--</a4j:outputPanel>-->
            </a4j:outputPanel>
        </ui:define>

        <ui:define name="actionCommand">
            <a4j:commandLink id="addPersonalMessage"
                             value="Add Personal Message.."
                             style="float:left; display:block;"
                             onclick="#{rich:element('newFriendMessagePanel')}.style.display='block';
                             this.style.display='none';"
                    />
            <a4j:commandButton id="submitButton"
                               type="submit"
                               styleClass="button"
                               value="#{resources.okButton}"
                               action="#{newFriendBean.action}"
                               reRender="#{reRender}"
                               oncomplete="Richfaces.hideModalPanel('#{id}');"

                    >
                <f:setPropertyActionListener value="#{newFriendSessionBean.forProccess.email}"
                                             target="#{createMessageBean.receivers}"/>
                <f:setPropertyActionListener value="Request Message" target="#{createMessageBean.topic}"/>
            </a4j:commandButton>
            <a4j:commandButton id="resetButton"
                               styleClass="button"
                               type="reset"
                               reRender="#{id}Form"
                               value="#{resources.cancelButton}"
                               onclick="Richfaces.hideModalPanel('#{id}');"/>

        </ui:define>
    </common:modalPanel>


</ui:component>


</html>